#ifndef __SPACEDEFENDER_GameController_H__
#define __SPACEDEFENDER_GameController_H__

#include <Ogre.h>
#define OIS_DYNAMIC_LIB
#include <OIS/OIS.h>

namespace spacedefender
{

class View;
class Model;

//using namespace Ogre;

class GameController : public Ogre::FrameListener, public OIS::MouseListener, public OIS::KeyListener
{
	public:
		GameController(View* view, Model* model);
		virtual ~GameController();
		
		virtual bool SetupInputSystem();
		virtual void MoveShip(Ogre::Real timeSinceLastFrame);
		
		
		// FrameListener overrides 
		virtual bool frameStarted(const Ogre::FrameEvent& evt); 
		virtual bool frameEnded(const Ogre::FrameEvent& evt); 
		
		// MouseListener
		virtual bool mouseMoved(const OIS::MouseEvent &evt);
		virtual bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id);
		virtual bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id);

		// KeyListener
		virtual bool keyPressed(const OIS::KeyEvent &evt);
		virtual bool keyReleased(const OIS::KeyEvent &evt);
	private:
		OIS::Keyboard* _keyboard;
		OIS::Mouse* _mouse;
		OIS::InputManager* _inputManager;
		
		View* _view;
		Model* _model;
		bool _keepRunning;
		bool _consoleKeyPressed;
		bool _consoleMode;
};

}
#endif // __SPACEDEFENDER_GameController_H__
